package com.houzehui.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.houzehui.entity.Fund;
import com.houzehui.mapper.FundMapper;
import com.houzehui.service.FundService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class FundServiceImpl implements FundService {

    @Autowired
    FundMapper fundMapper;

    @Override
    public List<Fund> list() {
        return fundMapper.list();
    }

    @Override
    public PageInfo<Fund> pageinfo(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Fund> list = fundMapper.list();
        return new PageInfo<>(list);
    }

    @Override
    public Fund selectbyid(Integer id) {
        return fundMapper.selectbyid(id);
    }
}
